﻿using DataServer.ApplicationLib.Services;
using Microsoft.AspNetCore.Mvc;

namespace Config.WebApi.Controllers
{
    [Route("api/v1/template")]
    [ApiController]
    public class TemplateController : ControllerBase
    {
        private readonly ITemplateService _templateService;
        private readonly ILogger<TemplateController> _logger;

        public TemplateController(ITemplateService templateService,
            ILogger<TemplateController> logger)
        {
            _templateService = templateService;
            _logger = logger;
        }

        [HttpGet("adHocReport")]
        public Task<IActionResult> GetUserAdHocReportTemplate()
        {
            // using var serverStreamingCall = this._templateService.GetUserTemplateCategories();
            //
            // var dtos = await GrpcUtil.StreamToListAsync<TemplateCategoryDto>(serverStreamingCall.ResponseStream);
            //
            // // 需将表格集合数据转化为树形集合数据
            //
            // return ResultMsg.Ok(dtos);

            return Task.FromResult<IActionResult>(Ok());
        }
    }
}